//
//  TagLabelView.m
//  PhotoTag
//
//  Created by Andrew on 2018/8/3.
//  Copyright © 2018年 Andrew. All rights reserved.
//

#import "TagLabelView.h"

@interface TagLabelView () <UITextFieldDelegate>


@property (weak, nonatomic) IBOutlet UITextField *inputTF;

@end


@implementation TagLabelView

- (void)awakeFromNib
{
    [super awakeFromNib];
    
    self.inputTF.delegate = self;
    [self.inputTF becomeFirstResponder];
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    if (self.tagLabelViewBlock) {
        self.tagLabelViewBlock(textField.text);
    }
    
    [self removeFromSuperview];
    
    return YES;
}



@end
